An AWS client has brought servers and databases from data centers
in different parts of the world for their application. For simplicity, let's assume all the servers and data centers are located on a 1- dimensional line.
You have been given the task of optimizing the network connection. Each data center must be connected to a server. The positions of n data centers and n servers are given in the form of arrays. Any particular data center, center[1], can deliver to any particular server destination, destination[J]. The lag is defined distance between a data center at location x and a lerver destination at location yis | x- yl, i.e., the absolute difference between x and y. Determine the minimum lag to establish the entire network.
Example
There are n = 3 connections, the positions of data centers, center = [1, 2, 2], and the positions of the server destinations, destination = [5, 2, 4].
שלחו מבחן בית במייל חוזר אחרי שהגשתי קורות חיים באתר שלהם
שאלות מתוך הראיון
קלט של מחרוזת עם אותיות וצריך למפות 26 אותיות באנגלית ל 9 מקשים בנייד כך שמספר הלחיצות על המקשים יהיה מינימלי ולהחזיר את מספר הלחיצות המינימלי. כך שאם נגיד a,b,c ממופים לאותו מקש אז צריך ללחוץ על המקש פעם 1 כדי לקבל a, פעמיים כדי ללחוץ על b, ושלוש פעמיים כדי ללחוץ על c.
תשובות
הוסף תשובה
|
לצפיה בתשובות
אוגוסט 2023
להשתמש ב hashTable של map/dict לכל אות לרשום את מספר הפעמים שמופיע במחרוזת ולפי התדירות להחליט לאיפה "למקם" במקשים.
הגשת קורות חיים דרך האתר שלהם-> קבלת מייל עם קישור לבחינת אונליין->קבלת מכתב דחייה
שאלות מתוך הראיון
שאלה 1: לא זוכר בדיוק אך כן זוכר שזו הייתה שאלה של 2 פויינטרים במערך.
שאלה 2: החזרת תת רשימה מקושרת הגדולה ביותר שממויינת בסדר יורד/עולה(לא זוכר בדיוק אבל זה אותו קונספט של פתרון לשני המקרים)